package com.jstower.common.controller;

import java.util.HashMap;

/**
 * Description: @ResponseBody的响应类,所有的获取数据请求都可返回此类,做为通用返回对象
 * 继承了hashMap,也就意味着定义的属性不够用,你可以任意的put值
 * Author: chenshuai
 * Project: js-webapp
 * Version: V1.0
 * Create Date: 16/3/1
 */
public class AppResponse extends HashMap<String,Object> {

    //返回的代码
    private int code;
    //返回的数据对象
    private Object data;
    //返回的错误消息
    private String message = "";
    //成功标志
    private boolean success = true;

    public AppResponse() {
        super();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {

        this.code = code;
        this.put("code",code);
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
        this.put("data",data);
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
        this.put("message",message);
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
        this.put("success",success);
    }
}
